package com.example.main;

import android.os.Bundle;
import android.os.Environment;
import android.support.annotation.Nullable;
import android.support.v4.app.FragmentActivity;
import android.view.View;
import android.widget.Button;

import com.example.main.utils.ReadExcel;

import java.io.File;
import java.io.IOException;

public class LjxExcelActivity extends FragmentActivity {

    private Button btn_parse;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_easy_excel);
        btn_parse = findViewById(R.id.btn_parse);
        btn_parse.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                try {
                    String value = Environment.getExternalStorageDirectory().getPath() + File.separator + "aaa" + File.separator + "t1.xlsx";
                    ReadExcel readExcel = new ReadExcel();
                    readExcel.setInputFile(value);
                    readExcel.read();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        });
    }
}
